package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.dto.DishDTO;
import com.sky.dto.DishPageQueryDTO;
import com.sky.entity.Dish;
import com.sky.entity.DishFlavor;
import com.sky.enumeration.OperationType;
import com.sky.vo.DishVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

@Mapper
public interface DishMapper {
    @Select("select count(id) from dish where category_id = #{categoryId}")
    Integer countByCategoryId(Long categoryId);
    List<DishVO> getByPage(DishPageQueryDTO dishPageQueryDTO);
    @AutoFill(OperationType.INSERT)
    void insert(Dish dish);
    DishVO getById(Long id);
    @AutoFill(OperationType.UPDATE)
    void update(Dish dish);
    void deleteById(List<Long> ids);
    List<Dish> list(Long categoryId);
    void startOrStop(Integer status, Long id, LocalDateTime updateTime, Long updateUser);
    List<Dish> search(Dish dish);
    Integer countByMap(Map map);
}
